import Vue from 'vue'
import App from './App.vue'

//三级联动组件--全局组件
import TypeNav from '@/components/TypeNav';
import Carousel from "@/components/Carousel";
import Pagination from "@/components/Pagination";
import {Button,MessageBox} from 'element-ui'
//第一个参数：全局组件的名字 第二个参数：哪一个组件
Vue.component(TypeNav.name,TypeNav);
Vue.component(Carousel.name,Carousel);
Vue.component(Pagination.name,Pagination);
Vue.component(Button.name,Button);
//element组件注册第二种写法，挂载原型
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
//引入路由
import router from "@/router";
//引入仓库
import store from '@/store';
//测试
// import {reqCategoryList} from '@/api';
// reqCategoryList();

//引入mockServe.js
import '@/mock/mockServe.js';
//引入swiper
import 'swiper/css/swiper.css';
//全局引用Ajax请求方法，统一接口，统一引入
import * as API from "@/api";
//引入 图片懒加载
import VueLazyload from 'vue-lazyload';
import wx_ from '@/assets/wx.png';
//注册图片懒加载
Vue.use(VueLazyload,{
  //懒加载默认图片
  loading:wx_,
})
//引入表单校验插件
import "@/plugins/validate";
Vue.config.productionTip = false;

new Vue({
  //全局总线$bus配置
  beforeCreate(){
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  render: h => h(App),
  //注册路由
  router,
  //注册仓库
  store
}).$mount('#app')
